From: Fomafix Date: Tue, 5 Apr 2016 13:37:55 +0000 (+0000) Subject: Simplify by using mw.util.getUrl() instead of mw.util.wikiScript() X-Git-Tag: 1.31.0-rc.0~7374^2 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=6e2cbcd3d4a3af2ff8357394b004f935872b4171;p=lhc%2Fweb%2Fwiklou.git Simplify by using mw.util.getUrl() instead of mw.util.wikiScript() Change-Id: Ie10a5ee79846a4f1465fea7ce1b47da13b0787b7 --- diff --git a/resources/Resources.php b/resources/Resources.php index 6992de1411..b206ba3cf5 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -1680,7 +1680,6 @@ return [ 'mediawiki.page.image.pagination' => [ 'scripts' => 'resources/src/mediawiki/page/image-pagination.js', 'dependencies' => [ - 'mediawiki.Uri', 'mediawiki.util', 'jquery.spinner', ], diff --git a/resources/src/mediawiki/page/image-pagination.js b/resources/src/mediawiki/page/image-pagination.js index a097b1796f..02bc1de949 100644 --- a/resources/src/mediawiki/page/image-pagination.js +++ b/resources/src/mediawiki/page/image-pagination.js @@ -99,16 +99,14 @@ function bindPageNavigation( $container ) { $container.find( '.multipageimagenavbox' ).one( 'click', 'a', function ( e ) { - var page, uri; + var page, url; // Generate the same URL on client side as the one generated in ImagePage::openShowImage. // We avoid using the URL in the link directly since it could have been manipulated (bug 66608) page = Number( mw.util.getParamValue( 'page', this.href ) ); - uri = new mw.Uri( mw.util.wikiScript() ) - .extend( { title: mw.config.get( 'wgPageName' ), page: page } ) - .toString(); + url = mw.util.getUrl( mw.config.get( 'wgPageName' ), { page: page } ); - switchPage( uri ); + switchPage( url ); e.preventDefault(); } ); diff --git a/resources/src/mediawiki/page/watch.js b/resources/src/mediawiki/page/watch.js index 578c846cc5..a57d5c77b8 100644 --- a/resources/src/mediawiki/page/watch.js +++ b/resources/src/mediawiki/page/watch.js @@ -46,11 +46,7 @@ .text( mw.msg( msgKey ) ) .attr( 'title', mw.msg( 'tooltip-ca-' + action ) ) .updateTooltipAccessKeys() - .attr( 'href', mw.util.wikiScript() + '?' + $.param( { - title: title, - action: action - } ) - ); + .attr( 'href', mw.util.getUrl( title, { action: action } ) ); // Most common ID style if ( $li.prop( 'id' ) === 'ca-' + otherAction ) {